#include <iostream>
#include <vector>
using namespace std;

void countRabbit(int N) {
	vector<int> rabbit({ 3 });
	int month = 0;
	while (month < N) {
		month += 1;
		int birth = 0;
		for (auto &item : rabbit) {
			if (item == 0)
				birth++;
			else {
				item -= 1;
				if (item == 0)
					birth++;
			}
		}
		for (int i = 0; i < birth; i++)
			rabbit.push_back(2);
	}
	cout << rabbit.size() << endl;
}

int main() {
	int N;
	cin >> N;
	countRabbit(N);
}
